#include "TimerOne.h"
#include <avr/io.h> 
#include <avr/interrupt.h> 

void setup()
{
  pinMode(13,OUTPUT);
  Serial.begin(115200);
  Serial.flush();
  Serial.println("Type any character to start");
  //while (!Serial.available());

  
  initTimer();
}

void initTimer()
{
  //Timer1.initialize(625);         // initialize timer1, and set a 1/2 second period
  Timer1.initialize(625);         // initialize timer1, and set a 1/2 second period
  Timer1.attachInterrupt(callback);  // attaches callback() as a timer overflow interrupt
}

void loop()
{
}

int count=0;

//verified @ 625ms timer runs at 803z, this verifies that this is running at ~1600 Hz
void callback()
{
  count++;
  if(count%2)
  {
  digitalWrite(13,HIGH);
  }
  else{
  digitalWrite(13,LOW);
  }
}


































